// newmodels/businessSchema.js
const mongoose = require('mongoose');

//业务信息登记表

const businessSchema = new mongoose.Schema({
  machineId: { type: mongoose.Schema.Types.ObjectId, ref: 'Machine', required: true }, // 机器的ID
  userId: { type: mongoose.Schema.Types.ObjectId, ref: 'users', required: true }, // 用户表的ID
  solutionInfo: { type: String, default: "待添加" }, // 处理方案信息
  isPaymentReceived: { type: Boolean, default: false }, // 是否收款，默认为false
  status: { type: String, enum: ['待联系', '已处理', '滞留',], default: '待联系' }, // 处理状态，默认为未处理
  createdAt: { type: Date, default: Date.now }, // 创建时间，默认为当前时间
  updatedAt: { type: Date, default: Date.now } // 修改的时间，默认为当前时间
});

module.exports = mongoose.model('Businessinfo', businessSchema);